package lab02.Test17;

import org.omg.CORBA.SetOverrideType;
import sun.security.x509.InvalidityDateExtension;

/**
 * Created by 卡01 on 2017/10/26.
 */
public class Test {
    public static void main(String[] args) {
        int [] numbers = new int[5];
        //ctrl + d: 复制一行
        //ctrl + x：删除一行
        numbers[0] = 12;
        numbers[1] = 9;
        numbers[2] = 26;
        numbers[3] = 54;
        numbers[4] = 99;
        //1.最大值及其位置
        //2.最小值及其位置
        //3.总和
        //打印数组元素
        System.out.println(numbers[0]);
        System.out.println(numbers[1]);
        System.out.println(numbers[2]);
        System.out.println(numbers[3]);
        System.out.println(numbers[4]);
        //下标：0-4
        int index;
        for(index = 0;index<numbers.length;index++){
            System.out.println(numbers[index]);
        }
        int sum = 0;
        int i;
        for(i = 0;i<numbers.length;i++) {
            sum += numbers[i];
        }
        System.out.println("总和是："+sum);
        }

    }

